#NoTrayIcon
#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\qp.ico
#AutoIt3Wrapper_Outfile=qp_ar.exe
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

If Not IsAdmin() Then Exit MsgBox(0, "qp ver 0.1.5", "No admin rights!")
If $CmdLine[0] <> 2 Then Exit MsgBox(0, "qp ver 0.1.5", "Invalid arguments!")

Switch $CmdLine[2]
	Case 1
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "qp.exe", "REG_SZ", $CmdLine[1])
	Case 0
		RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "qp.exe")
EndSwitch